﻿using AnimeLibrary.App_Code;
using System;
using System.Data;

namespace AnimeLibrary
{
    public partial class _default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                BindData();
            }
        }

        private void BindData()
        {
            try
            {
                DataTable dtAnimeLibrary = ReadOp.GetDataTable(Request.MapPath("App_Data\\AnimeLibrary.accdb"), "SELECT TOP 5 * FROM tbl_anime_library ORDER BY [ID] DESC");

                rptAnimeLibraryList.DataSource = dtAnimeLibrary;
                rptAnimeLibraryList.DataBind();
            }
            catch (Exception ex)
            {
                Response.Write(ex.Message);
            }
        }
    }
}